<template>
	<view>
		<cu-custom class="bgmains" bgColor="" :isBack="true">
		    <view slot="content">我的分销</view>
		</cu-custom>
		
		
		<image :src=" fileUrl+'dis/bg.png'" style="width: 100%;" mode="widthFix"></image>
		<view class="padding" style="position: absolute;top: 10%;width: 100%;">
			<view class="flex align-center margin-bottom">
				<image class="avatar" :src="userInfo.avatar"></image>
				<view class="text-lg text-bold">{{userInfo.nickname}}</view>
			</view>
			<view class="number_box">
				<image :src="fileUrl+'dis/bg-black.png'" style="width: 100%;" mode="widthFix"></image>
				<view class="info_box">
					<view class="title">可提现</view>
					<view class="flex align-center justify-between">
						<view class="balance">{{userInfo.spread_balance}}</view>
						<view class="btns" @click="go('/gc_school/pages/distribution/tixian')">提现</view>
					</view>
					<view class="flex margin-top price_box justify-around">
						<!-- <view class="price_item">
							<view class="title">待入账（元）</view>
							<view class="price">399</view>
						</view> -->
						<view class="price_item">
							<view class="title">提现中（元）</view>
							<view class="price">{{userInfo.tixian_ing}}</view>
						</view>
						<view class="price_item">
							<view class="title">已提现（元）</view>
							<view class="price">{{userInfo.tixian_have}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<view class="flex middle_box padding justify-between margin-top">
			<view class="middle_item flex align-center">
				<image :src=" fileUrl+'dis/money.png'"></image>
				<view>
					<view class="num">{{userInfo.spread_money}}</view>
					<view class="explain">累计佣金（元）</view>
				</view>
			</view>
			<view class="middle_item flex align-center">
				<image :src="fileUrl+'dis/tuiguang.png'"></image>
				<view>
					<view class="num">{{userInfo.spread_num}}</view>
					<view class="explain">推广人数（人）</view>
				</view>
			</view>
		</view>
		
		<view class="padding menu flex">
			<view class="menu_item flex align-center" @click="go('/gc_school/pages/distribution/profit')">
				<image :src="fileUrl+'dis/shouyi.png'"></image>
				<view>
					<view class="explain">收益报表</view>
					<view class="num">查看收益</view>
				</view>
			</view>
			<view class="menu_item flex align-center" @click="go('/gc_school/pages/distribution/accountlog')">
				<image :src="fileUrl+'dis/order.png'"></image>
				<view>
					<view class="explain">佣金明细</view>
					<view class="num">变动记录</view>
				</view>
			</view>
			<view class="menu_item flex align-center" @click="go('/gc_school/pages/distribution/team')">
				<image :src="fileUrl+'dis/team.png'"></image>
				<view>
					<view class="explain">我的团队</view>
					<view class="num">{{userInfo.team_count}}人</view>
				</view>
			</view>
			<view class="menu_item flex align-center" @click="go('/gc_school/pages/distribution/poster')">
				<image :src="fileUrl+'dis/share.png'"></image>
				<view>
					<view class="explain">分享海报</view>
					<view class="num">查看海报</view>
				</view>
			</view>
		</view>
		
	</view>
	
</template>

<script>
	var app = getApp()
	export default{
		data(){
			return{
				userInfo:{}
			}
		},
		onShow() {
			this.getUserInfo()
		},
		methods:{
			getUserInfo()
			{
				var t = this;
				app.globalData.util.request({
					url: 'WechatUser/spreadinfo',
					data: {},
					success(res)
					{
						console.log(res.data.data)
						t.userInfo = res.data.data
					}
				},true)
			}
		}
	}
</script>

<style lang="scss">
	.bgmains {
	    background: #0000 !important;
	    position: absolute;
	}
	.avatar{
		width: 70rpx;
		height: 70rpx;
		border-radius: 50%;
		margin-right: 10rpx;
	}
	.number_box{
		position: relative;
		.info_box{
			position: absolute;
			top: 7%;
			padding: 30rpx;
			width: 100%;
			.balance{
				font-size: 54rpx;
				color: #FAD9AB;
			}
			.btns{
				background: linear-gradient(98deg, #FCE0B2 0%, #EFB368 100%);
				border-radius: 40rpx;
				padding: 0 50rpx;
				height: 70rpx;
				line-height: 70rpx;
				color: #222222;
				font-size: 30rpx;
			}
		}
		.title{
			font-size: 24rpx;
			color: white;
			margin-bottom: 10rpx;
			opacity: 0.8;
		}
		.price_box{
			.price_item{
				// width: 33%;
				text-align: center;
				.price{
					font-size: 36rpx;
					color: #FAD9AB;
				}
			}
		}
	}
	.middle_box{
		.middle_item{
			background-color: white;
			border-radius: 10rpx;
			padding: 40rpx 30rpx;
			width: 48%;
			image{
				width: 74rpx;
				height: 66rpx;
				margin-right: 20rpx;
			}
			.num{
				font-size: 38rpx;
				color: #232323;
				font-weight: bold;
			}
			.explain{
				color: #666666;
				font-size: 22rpx;
				margin-top: 5rpx;
			}
		}
	}
	.menu{
		margin: 10rpx 30rpx;
		background-color: white;
		border-radius: 10rpx;
		flex-wrap: wrap;
		.menu_item{
			margin-top: 20rpx;
			margin-bottom: 10rpx;
			width: 50%;
			image{
				width: 54rpx;
				height: 54rpx;
				margin-right: 20rpx;
			}
			.explain{
				color: #232323;
				font-size: 28rpx;
				font-weight: bold;
			}
			.num{
				margin-top: 5rpx;
				color: #999999;
				font-size: 24rpx;
			}
		}
	}
</style>